/**
 *  初始化layui
 */
function initLayui() {
    /**
     *  监听
     */
    layui.use('form', function () {
        var form = layui.form;

        form.on('submit(demo1)', function (data) {
            loading();
            $.ajax({
                url: WebContext + "/carType/addType",
                data: {
                    "typeName":$("#name").val().trim()
                },
                type: "GET",
                dataType: "json",
                success: function (data) {
                    if (data.success) {
                        loading(1);
                        getIframeWindowByContent("汽修类型管理").tableRefresh("suppliesTable", true, null, null);
                        closeByBtnInSubPage(getITagByContent("新增汽修类型"));
                    }
                }
            });
        });

    });
}

$(function () {
    initLayui();
});



